﻿package mortal.game.scene3D.layer3D
{
    import flash.utils.*;
    import mortal.game.scene3D.player.entity.*;

    public class NPCDictionary extends Object
    {
        private var _map:Dictionary;

        public function NPCDictionary(param1:Boolean = false)
        {
            this._map = new Dictionary(param1);
            return;
        }// end function

        public function addNpc(param1:int, param2:NPCPlayer) : NPCPlayer
        {
            this._map[param1] = param2;
            return param2;
        }// end function

        public function removeNpc(param1:int) : NPCPlayer
        {
            var _loc_2:* = this._map[param1];
            if (_loc_2)
            {
                delete this._map[param1];
            }
            return _loc_2;
        }// end function

        public function removeAllNpc() : void
        {
            this._map = new Dictionary();
            return;
        }// end function

        public function getNpc(param1:int) : NPCPlayer
        {
            return this._map[param1];
        }// end function

        public function get map() : Dictionary
        {
            return this._map;
        }// end function

        public function removeAll() : void
        {
            var _loc_1:NPCPlayer = null;
            for each (_loc_1 in this._map)
            {
                
                if (_loc_1)
                {
                    _loc_1.dispose();
                }
            }
            this.removeAllNpc();
            return;
        }// end function

    }
}
